/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package stis.statpro.ibs.view;

import java.awt.AWTException;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.text.Format;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Formatter;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import stis.statpro.ibs.controller.CardLayoutController;
import stis.statpro.ibs.dao.KabupatenDao;
import stis.statpro.ibs.dao.KecamatanDao;
import stis.statpro.ibs.dao.PerusahaanDao;
import stis.statpro.ibs.dao.ProvinsiDao;
import stis.statpro.ibs.dao.ResumeDao;
import stis.statpro.ibs.model.Kabupaten;
import stis.statpro.ibs.model.Kecamatan;
import stis.statpro.ibs.model.Perusahaan;
import stis.statpro.ibs.model.Provinsi;
import stis.statpro.ibs.validasi.Validasi;

/**
 *
 * @author habib <imamhabibpamungkas@gmail.com>
 */
public class PanelMenuUtama extends javax.swing.JPanel {
    
    String aksi="";
    Perusahaan p;
    /**
     * Creates new form PanelHome
     */
    public CardLayoutController layoutController;
    private Validasi validasi;

    public PanelMenuUtama() {
        layoutController = new CardLayoutController();
        initComponents();
        validasi = new Validasi(this);
        layoutController.setCardLayout((CardLayout) cardPanel.getLayout());
        layoutController.setJpanel(cardPanel);
        initAction();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        headerPanel1 = new stis.statpro.ibs.view.HeaderPanel();
        widgdetPanelWarna2 = new stis.statpro.ibs.widget.WidgdetPanelWarna();
        jProgressBar1 = new javax.swing.JProgressBar();
        cardPanel = new javax.swing.JPanel();
        panelHome = new stis.statpro.ibs.view.PanelHome();
        jPanel1 = new javax.swing.JPanel();
        panelInsertA = new stis.statpro.ibs.view.PanelInsertA();
        jPanel3 = new javax.swing.JPanel();
        panelInsertB1 = new stis.statpro.ibs.view.PanelInsertB();
        jPanel4 = new javax.swing.JPanel();
        panelInsertC2 = new stis.statpro.ibs.view.PanelInsertC();
        jPanel5 = new javax.swing.JPanel();
        panelModify1 = new stis.statpro.ibs.view.PanelModify();
        jPanel6 = new javax.swing.JPanel();
        panelRead1 = new stis.statpro.ibs.view.PanelRead();
        jPanel7 = new javax.swing.JPanel();
        panelDelete1 = new stis.statpro.ibs.view.PanelDelete();
        jPanel8 = new javax.swing.JPanel();
        panelMonitor1 = new stis.statpro.ibs.view.PanelMonitor();
        jPanel9 = new javax.swing.JPanel();
        chartPanel1 = new stis.statpro.ibs.view.ChartPanel();

        setMinimumSize(new java.awt.Dimension(665, 480));
        setPreferredSize(new java.awt.Dimension(655, 656));
        setLayout(new java.awt.BorderLayout());

        jPanel2.setPreferredSize(new java.awt.Dimension(655, 200));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(headerPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 850, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(headerPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
        );

        add(jPanel2, java.awt.BorderLayout.NORTH);

        widgdetPanelWarna2.setPreferredSize(new java.awt.Dimension(250, 25));
        widgdetPanelWarna2.setLayout(new java.awt.FlowLayout());

        jProgressBar1.setIndeterminate(true);
        widgdetPanelWarna2.add(jProgressBar1);

        add(widgdetPanelWarna2, java.awt.BorderLayout.PAGE_END);

        cardPanel.setLayout(new java.awt.CardLayout());
        cardPanel.add(panelHome, "card2");

        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.PAGE_AXIS));
        jPanel1.add(panelInsertA);

        cardPanel.add(jPanel1, "panelInsert");

        jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, javax.swing.BoxLayout.PAGE_AXIS));

        panelInsertB1.setMaximumSize(new java.awt.Dimension(647, 455));
        jPanel3.add(panelInsertB1);

        cardPanel.add(jPanel3, "panelInsertB");

        jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.PAGE_AXIS));

        panelInsertC2.setMaximumSize(new java.awt.Dimension(655, 453));
        panelInsertC2.setMinimumSize(new java.awt.Dimension(655, 453));
        panelInsertC2.setPreferredSize(new java.awt.Dimension(655, 453));
        jPanel4.add(panelInsertC2);

        cardPanel.add(jPanel4, "panelInsertC");

        jPanel5.setLayout(new javax.swing.BoxLayout(jPanel5, javax.swing.BoxLayout.PAGE_AXIS));
        jPanel5.add(panelModify1);

        cardPanel.add(jPanel5, "panelModify1");

        jPanel6.setLayout(new javax.swing.BoxLayout(jPanel6, javax.swing.BoxLayout.PAGE_AXIS));

        panelRead1.setMinimumSize(new java.awt.Dimension(850, 353));
        panelRead1.setPreferredSize(new java.awt.Dimension(850, 353));
        jPanel6.add(panelRead1);

        cardPanel.add(jPanel6, "panelView");

        jPanel7.setLayout(new javax.swing.BoxLayout(jPanel7, javax.swing.BoxLayout.PAGE_AXIS));
        jPanel7.add(panelDelete1);

        cardPanel.add(jPanel7, "card9");

        jPanel8.setMaximumSize(new java.awt.Dimension(446, 236));
        jPanel8.setMinimumSize(new java.awt.Dimension(446, 236));
        jPanel8.setPreferredSize(new java.awt.Dimension(446, 236));
        jPanel8.setLayout(new javax.swing.BoxLayout(jPanel8, javax.swing.BoxLayout.PAGE_AXIS));
        jPanel8.add(panelMonitor1);

        cardPanel.add(jPanel8, "cardMonitor");

        jPanel9.setLayout(new javax.swing.BoxLayout(jPanel9, javax.swing.BoxLayout.PAGE_AXIS));
        jPanel9.add(chartPanel1);

        cardPanel.add(jPanel9, "card10");

        add(cardPanel, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    public JPanel getCardPanel() {
        return cardPanel;
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel cardPanel;
    private stis.statpro.ibs.view.ChartPanel chartPanel1;
    private stis.statpro.ibs.view.HeaderPanel headerPanel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JProgressBar jProgressBar1;
    private stis.statpro.ibs.view.PanelDelete panelDelete1;
    private stis.statpro.ibs.view.PanelHome panelHome;
    private stis.statpro.ibs.view.PanelInsertA panelInsertA;
    private stis.statpro.ibs.view.PanelInsertB panelInsertB1;
    private stis.statpro.ibs.view.PanelInsertC panelInsertC2;
    private stis.statpro.ibs.view.PanelModify panelModify1;
    private stis.statpro.ibs.view.PanelMonitor panelMonitor1;
    private stis.statpro.ibs.view.PanelRead panelRead1;
    private stis.statpro.ibs.widget.WidgdetPanelWarna widgdetPanelWarna2;
    // End of variables declaration//GEN-END:variables

    private void initAction() {
        panelHome.getPanelMenu1().addAclionListenerInsert(new aksiButtonInsert());
        panelHome.getPanelMenu1().addAclionListenerModify(new aksiButtonModify());
        panelHome.getPanelMenu1().addAclionListenerDelete(new aksiDelete());
        panelHome.getPanelMenu1().addAclionListenerMonitor(new aksiMonitor());
        panelHome.getPanelMenu1().addAclionListenerChart(new aksiChart());
        chartPanel1.addListenerButtonHome(new aksiHome());
        panelInsertA.addListenerNext(new aksiNextInsertA());
        panelInsertB1.addListenerNext(new aksiNexInsertB());
        panelInsertC2.addButtonBatalListener(new aksiBatalInsertC());
        panelInsertC2.addButtonSaveListener(new aksiSaveInsertC());
        panelModify1.addListenerModify(new aksiModify());
        panelModify1.addListenerBatal(new aksiHome());
        panelInsertB1.addListenerPrev(new aksiPrevInsertB());
        panelInsertC2.addButtonPrevListener(new aksiPrevC());
        panelHome.getPanelMenu1().addAclionListenerView(new aksiView());
        panelRead1.getButtonHome().addActionListener(new aksiHome());
        panelDelete1.addListenerHome(new aksiHome());
        panelMonitor1.getButtonHome().addActionListener(new aksiHome());
    }

    private void initComboBox(Perusahaan pe) throws SQLException {
        int indp = 0;
        int temp = 0;
        int indKab = 0;
        int indKec = 0;
        int i = 0;
        ProvinsiDao p = new ProvinsiDao();
        for (Provinsi prov : p.getALl()) {
            if (prov.getNama().equalsIgnoreCase(pe.getPropinsi())) {
                indp = i;
                temp = prov.getId();
                break;
            }
            i++;
        }
        panelInsertA.initDataProp(indp);
        i = 0;
        KabupatenDao kab = new KabupatenDao();
        for (Kabupaten k : kab.getById(temp)) {
            if (k.getNama().equalsIgnoreCase(pe.getKabupaten())) {
                indKab = i;
                temp = k.getIdKab();
                break;
            }
            i++;
        }
        panelInsertA.initDataKab(indKab);
        System.out.println(temp + " " + indKab);
        i = 0;
        KecamatanDao kec = new KecamatanDao();
        for (Kecamatan k : kec.getId(temp)) {
            if (k.getNama().equalsIgnoreCase(pe.getKecamatan())) {
                indKec = i;
                break;
            }
            i++;
        }
        panelInsertA.initDataKec(indKec);
    }

    class aksiChart implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            chartPanel1.initGrafik();
            layoutController.show("card10");
        }

    }

    class aksiMonitor implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("cardMonitor");
            try {
                ResumeDao r = new ResumeDao();
                panelMonitor1.getLabelJumlahPerusahaan().setText(Integer.toString(r.getJumlahRecord()));
                panelMonitor1.getLabelPMDN().setText(Integer.toString(r.getModalPmdn()));
                panelMonitor1.getLabelPMA().setText(Integer.toString(r.getModalPma()));
                panelMonitor1.getLabelNonFasilitas().setText(Integer.toString(r.getModalNon()));
                panelMonitor1.getLabelDiluarIndustri().setText(Integer.toString(r.getLuarIndustri()));
                panelMonitor1.getLabelIndustri().setText(Integer.toString(r.getDlmIndustri()));
                panelMonitor1.getLabelRataOmset().setText(String.format("%.2f", r.getRataOmset()));
                panelMonitor1.getLabelJumlahTenagaKerja().setText(Integer.toString(r.getJumlahTenagaKerja()));
            } catch (SQLException ex) {
                Logger.getLogger(PanelMonitor.class.getName()).log(Level.SEVERE, null, ex);
            }

        }

    }

    class aksiDelete implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("card9");
        }
    }

    class aksiHome implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            panelRead1.clearTable();
            panelDelete1.clearTable();
            layoutController.show("card2");
        }

    }

    class aksiView implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("panelView");
        }

    }

    class aksiPrevC implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("panelInsertB");
        }
    }

    class aksiPrevInsertB implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("panelInsert");
        }

    }

    class aksiModify implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            try {
                PerusahaanDao p = new PerusahaanDao();
                if (panelModify1.getTextKip().getText().trim().equals("")) {
                    JOptionPane.showMessageDialog(panelHome, "KIP Masih Kosong", "Error", JOptionPane.ERROR_MESSAGE);
                } else if (p.getPerusahaanByKip(Integer.parseInt(panelModify1.getTextKip().getText())) == null) {
                    JOptionPane.showMessageDialog(panelHome,new Object[]{"Perusahaan tidak ditemukan","Periksa Kembali KIP"}, "Error", JOptionPane.ERROR_MESSAGE);
                    panelModify1.getTextKip().setText("");
                } else {
                    Perusahaan per = p.getPerusahaanByKip(Integer.parseInt(panelModify1.getTextKip().getText()));
                    initComboBox(per);
                    isiData(per);
                    layoutController.show("panelInsert");
                    panelModify1.getTextKip().setText("");
                    panelInsertA.getKip().setEnabled(false);
                }
            } catch (SQLException ex) {
                Logger.getLogger(PanelMenuUtama.class.getName()).log(Level.SEVERE, null, ex);
            } catch (Exception ex) {
                Logger.getLogger(PanelMenuUtama.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }

    class aksiButtonModify implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            aksi="modifi";
            layoutController.show("panelModify1");
        }
    }

    class aksiSaveInsertC implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (validasi.validasi()) {
                String tampilan = panelInsertA.getTanggalInput().getDateFormatString();
                SimpleDateFormat dateFormat = new SimpleDateFormat(tampilan);
                String tanggal = String.valueOf(dateFormat.format(panelInsertA.getTanggalInput().getDate()));

                PerusahaanDao po = new PerusahaanDao();
                Perusahaan p = new Perusahaan();
                p.setKip(Integer.parseInt(panelInsertA.getKip().getText()));
                p.setPropinsi(panelInsertA.getPropinsi().getSelectedItem().toString());
                p.setKabupaten(panelInsertA.getKabupaten().getSelectedItem().toString());
                p.setKotaAdministratif(panelInsertA.getKotaAdministratif().getText());
                p.setKecamatan(panelInsertA.getKecamatan().getSelectedItem().toString());
                p.setDesaKelurahan(panelInsertA.getDesaKelurahan().getText());

                p.setNamaPrsh(panelInsertB1.getNamaPrsh().getText());
                p.setAlamatPrsh(panelInsertB1.getAlamatPrsh().getText());
                p.setEmailPrsh(panelInsertB1.getEmailPrsh().getText());
                p.setTelpPrsh(panelInsertB1.getTelpPrsh().getText());
                p.setKodeposPrsh(panelInsertB1.getKodeposPrsh().getText());
                p.setFaxPrsh(panelInsertB1.getFaxPrsh().getText());
                p.setAlamatKantorPusat(panelInsertB1.getAlamatPusat().getText());
                p.setEmailKantorPusat(panelInsertB1.getEmailPusat().getText());
                p.setTelpKantorPusat(panelInsertB1.getTelpPusat().getText());
                p.setKodeposKantorPusat(panelInsertB1.getKodeposPusat().getText());
                p.setFaxKantorPusat(panelInsertB1.getFaxPusat().getText());

                p.setStatusPenanamanModal(panelInsertC2.getStatusPenanamanModal().getSelectedItem().toString());
                p.setLokasiPrsh(panelInsertC2.getLokasiPrsh().getSelectedItem().toString());
                p.setAsetBangunan(panelInsertC2.getAsetBangunan().isSelected());
                p.setAsetKendaraan(panelInsertC2.getAsetKendaraan().isSelected());
                p.setAsetMesindanAlatBerat(panelInsertC2.getAsetMesindanAlatBerat().isSelected());
                p.setAsetGadget(panelInsertC2.getAsetGadget().isSelected());
                p.setAsetLainnya(panelInsertC2.getAsetLainnya().isSelected());
                p.setAsetDalamRupiah(Long.parseLong(panelInsertC2.getAsetDalamRupiah().getText()));
                p.setOmzetsebulanDalamRupiah(Long.parseLong(panelInsertC2.getOmzetsebulanDalamRupiah().getText()));
                p.setTenagakerja(Integer.parseInt(panelInsertC2.getTenagakerja().getText()));
                p.setTanggalInput(tanggal);
                if(aksi.equals("save")){
                    p.setUpdateData(true);
                }else{
                    p.setUpdateData(true);
                    try {
                        po.updatePerusahaan(p.getKip());
                    } catch (SQLException ex) {
                        Logger.getLogger(PanelMenuUtama.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }

                try {
                    po.savePerusahaan(p);
                    JOptionPane.showMessageDialog(panelInsertC2, "Data Berhasil disimpian", "Informasi", JOptionPane.INFORMATION_MESSAGE);
                    layoutController.show("card2");
                } catch (SQLException ex) {
                    Logger.getLogger(PanelMenuUtama.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
    }

    class aksiBatalInsertC implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("card2");
        }
    }

    class aksiNexInsertB implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("panelInsertC");
            panelInsertC2.getKip().setText(panelInsertA.getKip().getText());
        }
    }

    class aksiNextInsertA implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            layoutController.show("panelInsertB");
            panelInsertB1.getKip().setText(panelInsertA.getKip().getText());
        }
    }

    class aksiButtonInsert implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            aksi="save";
            layoutController.show("panelInsert");
            clearData();
            if (!panelInsertA.getKip().isEnabled()) {
                panelInsertA.getKip().setEnabled(true);
            }
        }
    }

    private void clearData() {
        panelInsertA.getKip().setText(""); 
       panelInsertA.getTanggalInput().setDate(null);
//        panelInsertA.getPropinsi().setSelectedItem();
//        panelInsertA.getKabupaten().setSelectedItem();
        panelInsertA.getKotaAdministratif().setText("");
        //       panelInsertA.getKecamatan().setSelectedItem();
        panelInsertA.getDesaKelurahan().setText("");

        panelInsertB1.getNamaPrsh().setText("");
        panelInsertB1.getAlamatPrsh().setText("");
        panelInsertB1.getEmailPrsh().setText("");
        panelInsertB1.getTelpPrsh().setText("");
        panelInsertB1.getKodeposPrsh().setText("");
        panelInsertB1.getFaxPrsh().setText("");
        panelInsertB1.getAlamatPusat().setText("");
        panelInsertB1.getEmailPusat().setText("");
        panelInsertB1.getTelpPusat().setText("");
        panelInsertB1.getKodeposPusat().setText("");
        panelInsertB1.getFaxPusat().setText("");

        panelInsertC2.getStatusPenanamanModal().setSelectedIndex(0);

        panelInsertC2.getStatusPenanamanModal().setSelectedIndex(1);

        panelInsertC2.getStatusPenanamanModal().setSelectedIndex(2);

        panelInsertC2.getLokasiPrsh().setSelectedIndex(0);
        panelInsertC2.getLokasiPrsh().setSelectedIndex(1);

        panelInsertC2.getAsetBangunan().setSelected(false);
        panelInsertC2.getAsetKendaraan().setSelected(false);
        panelInsertC2.getAsetMesindanAlatBerat().setSelected(false);
        panelInsertC2.getAsetGadget().setSelected(false);
        panelInsertC2.getAsetLainnya().setSelected(false);
        panelInsertC2.getAsetDalamRupiah().setText("");
        panelInsertC2.getOmzetsebulanDalamRupiah().setText("");
        panelInsertC2.getTenagakerja().setText("");
    }

    private void isiData(Perusahaan p) {
        panelInsertA.getKip().setText(Integer.toString(p.getKip()));
        panelInsertA.getKotaAdministratif().setText(p.getKotaAdministratif());
        panelInsertA.getDesaKelurahan().setText(p.getDesaKelurahan());
        panelInsertB1.getNamaPrsh().setText(p.getNamaPrsh());
        panelInsertB1.getAlamatPrsh().setText(p.getAlamatPrsh());
        panelInsertB1.getEmailPrsh().setText(p.getEmailPrsh());
        panelInsertB1.getTelpPrsh().setText(p.getTelpPrsh());
        panelInsertB1.getKodeposPrsh().setText(p.getKodeposPrsh());
        panelInsertB1.getFaxPrsh().setText(p.getFaxPrsh());
        panelInsertB1.getAlamatPusat().setText(p.getAlamatKantorPusat());
        panelInsertB1.getEmailPusat().setText(p.getEmailKantorPusat());
        panelInsertB1.getTelpPusat().setText(p.getTelpKantorPusat());
        panelInsertB1.getKodeposPusat().setText(p.getKodeposKantorPusat());
        panelInsertB1.getFaxPusat().setText(p.getFaxKantorPusat());
        if (p.getStatusPenanamanModal().equalsIgnoreCase("1. PMDN")) {
            panelInsertC2.getStatusPenanamanModal().setSelectedIndex(0);
        } else if (p.getStatusPenanamanModal().equalsIgnoreCase("2. PMA")) {
            panelInsertC2.getStatusPenanamanModal().setSelectedIndex(1);
        } else if (p.getStatusPenanamanModal().equalsIgnoreCase("3. Non-Fasilitas")) {
            panelInsertC2.getStatusPenanamanModal().setSelectedIndex(2);
        }
        if (p.getLokasiPrsh().equalsIgnoreCase("1. Di dalam kawasan industri")) {
            panelInsertC2.getLokasiPrsh().setSelectedIndex(0);
        } else {
            panelInsertC2.getLokasiPrsh().setSelectedIndex(1);
        }
        panelInsertC2.getAsetBangunan().setSelected(p.isAsetBangunan());
        panelInsertC2.getAsetKendaraan().setSelected(p.isAsetKendaraan());
        panelInsertC2.getAsetMesindanAlatBerat().setSelected(p.isAsetMesindanAlatBerat());
        panelInsertC2.getAsetGadget().setSelected(p.isAsetGadget());
        panelInsertC2.getAsetLainnya().setSelected(p.isAsetLainnya());
        panelInsertC2.getAsetDalamRupiah().setText(Long.toString(p.getAsetDalamRupiah()));
        panelInsertC2.getOmzetsebulanDalamRupiah().setText(Long.toString(p.getOmzetsebulanDalamRupiah()));
        panelInsertC2.getTenagakerja().setText(Integer.toString(p.getTenagakerja()));
    }

    public PanelInsertA getPanelInsertA() {
        return panelInsertA;
    }

    public PanelInsertB getPanelInsertB1() {
        return panelInsertB1;
    }

    public PanelInsertC getPanelInsertC2() {
        return panelInsertC2;
    }

    public CardLayoutController getLayoutController() {
        return layoutController;
    }

}
